package com.c.controller;

import com.c.exceptions.MyException;
import com.c.pojo.enums.ResultEnum;
import com.c.pojo.vo.ResultVo;
import com.c.util.ResultUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author bysun
 */
@RestController
public class TestController {

    @GetMapping("hello")
    public ResultVo hello(Integer id) {
        if (id == null) {
            throw new MyException(ResultEnum.DEFAULT_ERROR);
        }
        return ResultUtil.success();
    }
}
